<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<div>div</div>   
<script>
    var div = document.querySelector('div')
    函数自执行
   ( function demo (){
        console.log(100)
    }) ()

div.addEventListener('click',function(){
    console.log(this.innerText)
})
    
</script> 
</body>
</html>